export class IParams {
    endpoint!: string

    bucketName?: string

    accessKeyID?: string

    accessKeySecret?: string

    securityToken?: string

    cacheType?: string

    command!: string

    fileID!: string

    fileParentID!: string

    engineTaskSign!: string

    pipelineID!: number

    pipelineName!: string

    buildNumber?: number

    operator!: string

    workspace!: string

    projectDir!: string

    pluginDir!: string

    buildJobID!: number

    cacheName!: string

    archivePath!: string

}

export function getParams(): IParams {
    let params = new IParams()
    params.endpoint = process.env.ENDPOINT as string
    params.bucketName = process.env.BUCKET_NAME as string
    params.accessKeyID = process.env.ACCESS_KEY_ID
    params.accessKeySecret = process.env.ACCESS_KEY_SECRET
    params.securityToken = process.env.SECURITY_TOKEN
    params.cacheType = process.env.CACHE_TYPE
    params.command = process.env.COMMAND as string
    params.fileID = process.env.FILE_ID as string
    params.fileParentID = process.env.FILE_PARENT_ID as string
    params.engineTaskSign = process.env.ENGINE_TASK_SIGN as string
    params.pipelineID = Number(process.env.PIPELINE_ID)
    params.pipelineName = process.env.PIPELINE_NAME as string
    params.buildNumber = Number(process.env.BUILD_NUMBER)
    params.operator = process.env.operator as string
    params.workspace = process.env.WORK_SPACE as string
    params.projectDir = process.env.PROJECT_DIR as string
    params.pluginDir = process.env.PLUGIN_DIR as string
    params.buildJobID = Number(process.env.BUILD_JOB_ID)
    params.cacheName = process.env.CACHE_NAME as string
    params.archivePath = process.env.ARCHIVE_PATH as string
    return params
}